package com.bnlr.lrparking.appui.publish.openenter;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.bnlr.lrparking.R;
import com.bnlr.lrparking.base.BaseActivity;
import com.bnlr.lrparking.event.ApplyEnterEvent;
import com.bnlr.lrparking.view.CarCommon;

import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * 开发商入驻
 */
public class OpenEnterActivity extends BaseActivity {
    private Unbinder unbinder;
    @BindView(R.id.tv_nav_title)
    TextView textView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_open_enter);
        unbinder = ButterKnife.bind(this);
        EventBus.getDefault().register(this);
        textView.setText("开发商入驻");
    }
    @OnClick({R.id.open_enter_apply,R.id.open_enter_call})
    public void openOnClick(View view) {
        switch (view.getId()) {
            case R.id.open_enter_apply:
                startActivity(new Intent(this,ApplyEnterActivity.class));
                break;
            case R.id.open_enter_call:
                new CarCommon().phoneDialog(this);
                break;
        }
    }
    @Subscribe(threadMode = ThreadMode.MAIN)
    public void onApplyEnterEvent(ApplyEnterEvent event) {
        finish();
    }
    @Override
    protected void onDestroy() {
        super.onDestroy();
        unbinder.unbind();
        EventBus.getDefault().unregister(this);
    }
}
